/**
 * @file   rate.hpp
 * @author Kimmo Luoma <kimmo@PHOTON3>
 * @date   Fri Sep  7 16:17:59 2012
 * 
 * @brief  Class for storing decay rates. It uses interpolation functions
 * from gsl package.
 * 
 */

#ifndef RATE_HPP
#define RATE_HPP
#include <boost/numeric/ublas/vector.hpp>
#include <gsl/gsl_interp.h>
#include <gsl/gsl_spline.h>
#include <typeinfo>

using namespace boost::numeric::ublas;

class rate{
private:
  gsl_interp_accel *acc;
  gsl_spline *spline;
  int n;
  double dt;
public:
  /** 
   * Default constructor
   * 
   */
  rate();
  /** 
   * Default destructor
   * 
   */
  ~rate();
  /** 
   * Constructor
   * 
   * @param d vector<double> data points
   * @param delta_t double time-step size
   */
  rate(vector<double> d,double delta_t);
  /** 
   * copy constructor
   * 
   * @param d objet of type rate
   */
  rate(const rate& d);        
  /** 
   * Copy assignment
   * 
   * @param d object of type rate
   * 
   * @return reference to object type rate
   */
  rate& operator=(const rate& d);
  /** 
   * Operator ()
   * 
   * @return value of decay rate at time t.
   * 
   */
  double operator()(double t);
  
};
#endif
